<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<!--#include file="admin/inc/conn.inc"-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>生成Club</title>
</head>

<body>
<%
	strPath = Server.MapPath("clubvip")
	set fs = CreateObject("Scripting.FileSystemObject")
	set folder = fs.GetFolder(strPath)
	Set oFSO = Server.CreateObject("Scripting.FileSystemObject") 
	for each item in folder.Files
		url = item.path
		If Right(url, 13) <> "Framework.htm" Then
			oFSO.DeleteFile(url)
		End If
	next
	set fs = nothing
	set folder = nothing
	
	strSql = "select * from GameClub "
	Set rs = Server.CreateObject("ADODB.Recordset")
	rs.Open strSQL, dbconnection, adOpenDynamic, 3
	Const ForReading = 1, ForWriting = 2   
	Dim f, objTypeLib   
	Set f = oFSO.OpenTextFile(server.mappath("clubvip\Framework.htm"), ForReading)
	ReadAllTextFileFinal = f.ReadAll   
	Set f = Nothing
	do while not rs.Eof
		ReadAllTextFile = ReadAllTextFileFinal
		ReadAllTextFile = replace(ReadAllTextFile,"$Name$",rs("Name")) 
		ReadAllTextFile = replace(ReadAllTextFile,"$Title$",rs("Title")) 
		ReadAllTextFile = replace(ReadAllTextFile,"$Pic$",rs("Pic")) 
		ReadAllTextFile = replace(ReadAllTextFile,"$Addr$",rs("Addr")) 
		ReadAllTextFile = replace(ReadAllTextFile,"$Tel$",rs("Tel")) 
		ReadAllTextFile = replace(ReadAllTextFile,"$QQ$",rs("QQ")) 
		ReadAllTextFile = replace(ReadAllTextFile,"$Other$",rs("Other")) 
		ReadAllTextFile = replace(ReadAllTextFile,"$Map$",rs("Map")) 
		ReadAllTextFile = replace(ReadAllTextFile,"$Summary$",rs("Summary"))
		ReadAllTextFile = replace(ReadAllTextFile,"$call_1$",rs("call_1"))
		ReadAllTextFile = replace(ReadAllTextFile,"$call_2$",rs("call_2"))
		ReadAllTextFile = replace(ReadAllTextFile,"$call_3$",rs("call_3"))
		ReadAllTextFile = replace(ReadAllTextFile,"$call_4$",rs("call_4"))
		ReadAllTextFile = replace(ReadAllTextFile,"$call_5$",rs("call_5"))
		ReadAllTextFile = replace(ReadAllTextFile,"$call_6$",rs("call_6"))
		ReadAllTextFile = replace(ReadAllTextFile,"$call_7$",rs("call_7"))
		ReadAllTextFile = replace(ReadAllTextFile,"$call_8$",rs("call_8"))
		ReadAllTextFile = replace(ReadAllTextFile,"$call_9$",rs("call_9"))
		ReadAllTextFile = replace(ReadAllTextFile,"$call_10$",rs("call_10"))
		ReadAllTextFile = replace(ReadAllTextFile,"$callname_1$",rs("callname_1"))
		ReadAllTextFile = replace(ReadAllTextFile,"$callname_2$",rs("callname_2"))
		ReadAllTextFile = replace(ReadAllTextFile,"$callname_3$",rs("callname_3"))
		ReadAllTextFile = replace(ReadAllTextFile,"$callname_4$",rs("callname_4"))
		ReadAllTextFile = replace(ReadAllTextFile,"$callname_5$",rs("callname_5"))
		ReadAllTextFile = replace(ReadAllTextFile,"$callname_6$",rs("callname_6"))
		ReadAllTextFile = replace(ReadAllTextFile,"$callname_7$",rs("callname_7"))
		ReadAllTextFile = replace(ReadAllTextFile,"$callname_8$",rs("callname_8"))
		ReadAllTextFile = replace(ReadAllTextFile,"$callname_9$",rs("callname_9"))
		ReadAllTextFile = replace(ReadAllTextFile,"$callname_10$",rs("callname_10"))
		
		Set objTypeLib = CreateObject("Scriptlet.TypeLib")
		strURL = objTypeLib.Guid
		strURL = Mid(strURL, 1, Len(strURL) - 2)
		rs("URL") = strURL
		rs.update
		
		Set f = oFSO.OpenTextFile(server.mappath("clubvip\" & rs("URL") & ".htm"), ForWriting, True)   
		f.Write ReadAllTextFile
		Set f = Nothing
		Set objTypeLib = Nothing
		rs.MoveNext
	Loop
	set rs = nothing
	set oFSO = nothing
	Response.Write("全部生成完成<br />")
	Response.Write("<meta HTTP-EQUIV=REFRESH CONTENT='1; URL=/'>生成成功，一秒钟后自动返回")
%>
</body>
</html>
<!--#include file="disconn.inc"-->